#ifndef TFRMUPDATPLUGIN_H
#define TFRMUPDATPLUGIN_H

#include <QWidget>
#include <QTextEdit>
#include <windows.h>

namespace Ui {
class TFrmUpDatPlugin;
}

class TFrmUpDatPlugin : public QWidget
{
    Q_OBJECT

public:
    explicit TFrmUpDatPlugin(QWidget *parent = nullptr);
    ~TFrmUpDatPlugin();

    void showLog(const QString &logStr);
    //设置服务句柄
    void setServerHandle(int serverHandle);

private:
    Ui::TFrmUpDatPlugin *ui;
    QTextEdit *m_teLog;
    //升级软件句柄
    int m_serverHandle;

    bool nativeEvent(const QByteArray &eventType,void *message,long *result) override;

public slots:
    //升级消息
    void slotUpdatMessage(int message,bool exitApp);
    //打印日志
    void slotShowLog(const QString &logStr);

private slots:
    //发送保持连接指令
    void slotSendKeepConnectMessage();

};

#endif // TFRMUPDATPLUGIN_H
